import type { STATUS } from '~@/utils/constant'

interface ConsultTableModel {
  list: Array<any>
  total: number
  // 分页
  current?: number
  // size
  pageSize?: number
}

interface ConsultTableFormModel {
  username: string
  phone: string
  nickname: string
}

type ConsultTableParams = Partial<Omit<ConsultTableModel, 'id'>>

export async function getListApi(params?: ConsultTableParams) {
  return usePost<ConsultTableModel[]>('/user/list', params)
}

export async function deleteApi(id: string | number) {
  return useDelete(`/list/${id}`)
}

export type{
  ConsultTableParams,
  STATUS,
  ConsultTableModel,
  ConsultTableFormModel,
}
